<template>
  <div class="home_box">
    <header-top class="headerTop"></header-top>
    <nav-top class="nav"></nav-top>
    <main-box class="main"></main-box>


  </div>
</template>

<script>
import headerTop from '../../components/header'
import navTop from '../../components/nav'
import footerBox from '../../components/footer'
import mainBox from '../../components/main'
  export default {
    components:{
      headerTop,
      navTop,
      footerBox,
      mainBox
    },
    created() {
      if(!localStorage.getItem('Access-Token')){
        this.$router.push({path:'/login'})
      }
      if(this.$route.path != '/index'){
        //this.$store.state.options = [{name: "首页",route: "/index"}]
        this.$store.commit("add_tabs", { route: this.$route.path, name: this.$route.name });
        this.$store.commit("set_active_index", this.$route.path);
      }
    },
  }
</script>

<style scoped>
  .headerTop{
    width: 100%;
    height: 50px;
  }
  .nav{
    width: calc(100% - 60px);
    min-height: 53px;
    background-color: #0d78be;
  }
  .main{
    width: calc(100% - 60px);
    min-height: 750px;
  }
  .footer{
    width: 100%;
    height: 0px;
    background-color: darkgrey;
  }
</style>
